package org.devocean.groupbuying.web.frontend.displaybeans;

import java.util.Iterator;

import org.devocean.groupbuying.domain.Article;
import org.devocean.groupbuying.domain.Deal;
import org.devocean.groupbuying.domain.Discount;

public class DiscountBean {

	private String title;
	private String value;
	private String discountValue;
	private String percent;
	private Deal deal;

	public DiscountBean(Discount discount) {
		Iterator<Article> it = discount.getFormula().getPlan()
				.getArticlesLocalization().getArticles().iterator();
		Article article = it.next();

		this.title = article.getTitle();
		this.value = discount.getFormula().getPrice().toString();
		this.discountValue = discount.getDiscountPrice().toString();
		this.percent = discount.getDiscountValue().toString();
		this.setDeal(discount.getDeal());

	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getDiscountValue() {
		return discountValue;
	}

	public void setDiscountValue(String discountValue) {
		this.discountValue = discountValue;
	}

	public String getPercent() {
		return percent;
	}

	public void setPercent(String percent) {
		this.percent = percent;
	}

	public Deal getDeal() {
		return deal;
	}

	public void setDeal(Deal deal) {
		this.deal = deal;
	}

}
